package com.k2data.k2app.mapper;

import com.k2data.k2app.domain.po.EarlyWaringDO;
import com.k2data.k2app.mybatis.mapper.K2Mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface EarlyWaringMapper extends K2Mapper<EarlyWaringDO> {

    EarlyWaringDO getById(Long id);

    @Override
    int insert(EarlyWaringDO earlyWaringDO);

    List<EarlyWaringDO> count();

    int insertBatch(List<EarlyWaringDO> list);

    List<EarlyWaringDO> selectWarnings(EarlyWaringDO earlyWaringDO);


    @Override
    int selectCount(EarlyWaringDO earlyWaringDO);

    List<EarlyWaringDO> getByModelId(Long modelId);

    @Override
    int updateByPrimaryKeySelective(EarlyWaringDO earlyWaringDO);

    EarlyWaringDO selectLatestData(@Param("deviceNo") String deviceNo, @Param("message") String message, @Param("level") String level);

}